package com.zhijian.warehouse.manage.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户相关枚举类
 *
 * @author HCG
 * @version 1.0
 * @date 2023-11-06
 */
public class UserEnum {

    /**
     * 用户状态
     */
    @AllArgsConstructor
    @Getter
    public enum UserStatusEnum {

        NORMAL(1, "正常"),
        CANCEL(0, "停用"),;

        private Integer code;
        private String msg;

        public static UserStatusEnum getByCode(Integer code) {
            UserStatusEnum[] values = UserStatusEnum.values();
            for (UserStatusEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }
    }

    /**
     * 工作状态枚举类
     */
    @AllArgsConstructor
    @Getter
    public enum JobStatusEnum {

        WORK(1, "在岗"),
        OFF(0, "离岗"),;

        private Integer code;
        private String msg;

        public static JobStatusEnum getByCode(Integer code) {
            JobStatusEnum[] values = JobStatusEnum.values();
            for (JobStatusEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }
    }

    /**
     * 小组or班级枚举类
     */
    @AllArgsConstructor
    @Getter
    public enum GroupOrClassEnum {

        /**
         * 班级
         */
        CLASS(1),

        /**
         * 小组
         */
        GROUP(2),;

        private Integer code;

    }
}
